<template lang="pug">
template(v-for="com in testData" :key="com.name")
  template(v-if="com.type==`sizeGroup`")
    Inputs(:inputs="com.sub" :comInfo="com")
//- zhengtao(:baojiaInfo="baojiaInfo" v-if="pageName=='枕套'")
//- maojin(:baojiaInfo="baojiaInfo" v-else-if="pageName=='毛巾' || pageName=='方巾'")
//- yupao(:baojiaInfo="baojiaInfo" v-else-if="pageName=='浴袍'")

//- template(v-else)
//-   zhengtao(:baojiaInfo="baojiaInfo" )
</template>
<script setup>
import Inputs from '@/components/forms/Inputs.vue'
// import zhengtao from '@/components/forms/zhengtao.vue'
// import maojin from '@/components/forms/maojin.vue'
// import yupao from '@/components/forms/yupao.vue'
const baojiaInfo = ref({})
const pageName = ref("")

const testData  = [
   {
      type: "sizeGroup", label: "枕套尺寸", name: "size", enable: true, extra: [
          {
              title: "输入枕芯尺寸", enable: true, fields: [
                  { label: "长", name: "length", },
                  { label: "宽", name: "width", },
              ], param: [
                  { type: "xl" },
              ],
          },
          {
              title: "输入床垫尺寸", enable: false, fields: [
                  { label: "长", name: "length", },
                  { label: "宽", name: "width", },
                  { label: "高", name: "height", },
              ], param: [
                  { type: "cd" },
              ],
          },
      ], 
      sub: [
          { label: "长", name: "length", enable: true, max: 500, min: 100, value: 0, },
          { label: "宽", name: "width", enable: true, max: 500, min: 100, value: 0, },
          { label: "四周飞边", name: "outside", enable: true, max: 10, min: 0, value: 0, },
          { label: "压舌", name: "cover", enable: true, max: 30, min: 0, value: 0, },
          { label: "卷边长", name: "borderLength", enable: false, max: 10, min: 0, value: 0, },
          { label: "卷边宽", name: "borderWidth", enable: false, max: 10, min: 0, value: 0, },
          { label: "高", name: "height", enable: false, max: 30, min: 0, value: 0, },
      ],
  },
]

onLoad(op=>{
  console.log('pagenname=====',op);
  let name = decodeURIComponent(op.name);
  const _op = {
    ...op,
    name,
  }
  console.log('pagenname=====',name);
 
  baojiaInfo.value = _op;
  pageName.value = name;  
  
  uni.setNavigationBarTitle({
    title:name
  });
})

</script>
<style scoped lang="scss">

</style>